package com.zhu.blog.service;




import com.zhu.blog.model.Blog;
import com.zhu.blog.dto.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;


public interface BlogService {
    Blog getBlog(Long id);

    //获取该id内容并转换成Html格式的方法
    Blog getAndConvert(Long id);

    //分页
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    //博客标签页根据tagId进行分页
    Page<Blog> listTag(Long tagId,Pageable pageable);

    //博客首页的分页展示
    Page<Blog> listIndexBlog(Pageable pageable);

    //展示博客首页右边推荐recommend的内容
    List<Blog> listBlogRecommendTop(Integer size);

    //对博客所有内容进行归档
    Map<String,List<Blog>> archivesBlog();

    //归档所有博客的数目
    Long countBlog();

    //根据输入的字符串查询
    Page<Blog> listBlogQuery(String query,Pageable pageable);

    int updateViews(Long id);

    //新增
    Blog saveBlog(Blog blog);
    Blog updateBlog(Long id, Blog blog);
    void deleteBlog(Long id);

}
